﻿
    
    <ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c="clr-namespace:TagFlo"
        >
 <!-- xmlns:c="clr-namespace:TagFlo"
	xmlns:v="clr-namespace:TagFlo.Views"
-->
 <!-- 
  *****************************************************************
  SharedBrushes
  *****************************************************************
  -->
   <SolidColorBrush x:Key="BorderBrush" Color="#FFA3A3A3"/>
    
    <SolidColorBrush x:Key="BackgroundBrush" Color="#FFF0F0F0"/>
    
    <SolidColorBrush x:Key="PanelBackgroundBrush" Color="#FFE3E3E3"/>
   <!-- <SolidColorBrush x:Key="ControlBackgroundBrush" Color="#FFCCCCCC" />-->
    <SolidColorBrush x:Key="ControlBorderBrush" Color="#FFA3A3A3" />
    <SolidColorBrush x:Key="ControlForegroundBrush" Color="#FF636363" />
    <SolidColorBrush x:Key="MouseOverForegroundBrush" Color="#444" />
    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888"/>

    <SolidColorBrush x:Key="ForegroundBrush" Color="#636363" />

    <SolidColorBrush x:Key="GlyphBrush" Color="#444"/>
    <SolidColorBrush x:Key="GlyphOverBrush" Color="Orange"/>
    <SolidColorBrush x:Key="GlyphPressedBrush" Color="OrangeRed"/>


<!--
    <SolidColorBrush x:Key="BorderBrush" Color="#FF68685E"/>
    
    <SolidColorBrush x:Key="BackgroundBrush" Color="#FFF4F3DC"/>
    
    <SolidColorBrush x:Key="PanelBackgroundBrush" Color="#FFCECDBA"/>
    <SolidColorBrush x:Key="ControlBackgroundBrush" Color="#FFA8A797" />
    <SolidColorBrush x:Key="ControlBorderBrush" Color="#FF68685E" />
    <SolidColorBrush x:Key="ControlForegroundBrush" Color="#FF68685E" />

    <SolidColorBrush x:Key="ForegroundBrush" Color="#636363" />

    <SolidColorBrush x:Key="GlyphBrush" Color="#444"/>
    <SolidColorBrush x:Key="GlyphOverBrush" Color="Orange"/>
    <SolidColorBrush x:Key="GlyphPressedBrush" Color="OrangeRed"/>
-->
<!-- ************************************************************** -->

  <SolidColorBrush x:Key="RaisedShadow" Color="#000000" />

  <SolidColorBrush x:Key="DisabledForeground" Color="#777" />

  <LinearGradientBrush x:Key="ControlBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0.0" Color="#FFF0F0F0" />
    <GradientStop Offset="1.2" Color="#FFCCCCCC" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="MouseDownBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0.0" Color="#FFCCCCCC" />
        <GradientStop Offset="1.2" Color="#FFF0F0F0" />
    </LinearGradientBrush>

  <LinearGradientBrush x:Key="MouseOverBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0.0" Color="#FFF0F0F0" />
        <GradientStop Offset=".8" Color="#FFCCCCCC" />
    </LinearGradientBrush>

<!--
<LinearGradientBrush x:Key="Normal" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0.0" Color="#585858" />
    <GradientStop Offset="1.2" Color="#282828" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="Down" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0.0" Color="#505050" />
    <GradientStop Offset="1.2" Color="#303030" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="MouseOver" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0.0" Color="#686868" />
    <GradientStop Offset="1.2" Color="#282828" />
  </LinearGradientBrush>-->

  <LinearGradientBrush x:Key="Checked" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Offset="0.0" Color="#404040" />
    <GradientStop Offset="1.2" Color="#181818" />
  </LinearGradientBrush>

<TranslateTransform Y="-1" x:Key="Up1" />
  <TranslateTransform Y="1" x:Key="Down1" />

  
    <!-- 
  *****************************************************************
  Button
  *****************************************************************
  -->
<!--
  <Style TargetType="{x:Type Button}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
    <Setter Property="FontSize" Value="7.5pt"/>
    <Setter Property="MinHeight" Value="20"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Grid>
            <Border x:Name="ButtonBackground" BorderBrush="{StaticResource RaisedHighlight}" BorderThickness="1,1,0,0">
              <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                  <GradientStop Offset="0.0" Color="#585858" />
                  <GradientStop Offset="1.2" Color="#282828" />
                </LinearGradientBrush>
              </Border.Background>
            </Border>
            <Border x:Name="ButtonShadow" BorderBrush="{StaticResource RaisedShadow}" BorderThickness="0,0,1,1" CornerRadius="0" />

            <ContentPresenter
              x:Name="Content"
              Margin="0,0,0,2"
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
              RecognizesAccessKey="True"/>

          </Grid>
          
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Trigger.EnterActions>
                <BeginStoryboard>
                  <Storyboard>
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="#888888" Duration="0:0:0.1" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" To="#686868" Duration="0:0:0.1" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" To="#282828" Duration="0:0:0.1" />
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard>
                  <Storyboard>
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Duration="0:0:0.1" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" Duration="0:0:0.2" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0:0:0.2" />
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.ExitActions>
            </Trigger>
            <Trigger Property="IsFocused" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard>
                  <Storyboard>
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="#989898" Duration="0:0:0.1" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" To="#787878" Duration="0:0:0.1" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" To="#383838" Duration="0:0:0.1" />
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard>
                  <Storyboard>
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Duration="0:0:0.1" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" Duration="0:0:0.2" />
                    <ColorAnimation Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0:0:0.2" />
                  </Storyboard>
                </BeginStoryboard>
              </Trigger.ExitActions>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter TargetName="Content" Property="RenderTransform">
                <Setter.Value>
                  <TranslateTransform Y="1" />
                </Setter.Value>
              </Setter>
              <Setter TargetName="ButtonShadow" Property="RenderTransform">
                <Setter.Value>
                  <TranslateTransform Y="1" />
                </Setter.Value>
              </Setter>
              <Setter TargetName="ButtonShadow" Property="BorderBrush" Value="#555" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="{StaticResource DisabledForeground}"/>
              <Setter Property="Opacity" Value="0.75"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>-->

  
    <!-- SimpleStyles: TreeViewItem x:Key="TreeView" -->

    <!--<Style TargetType="{x:Type c:Views.SelectionPanel}" BasedOn="{StaticResource {x:Type TreeView}}"/>
    <Style TargetType="{x:Type c:Views.SelectionPanelItem}" BasedOn="{StaticResource {x:Type TreeViewItem}}"/>-->


      
    
    <Style TargetType="{x:Type TreeView}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeView}">
                    
                        <ScrollViewer 
            Focusable="False"
            CanContentScroll="False"
            Padding="4">
                            <ItemsPresenter/>
                        </ScrollViewer>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid
          Width="15"
          Height="13"
          Background="Transparent">
                        <Path x:Name="ExpandPath"
            HorizontalAlignment="Left" 
            VerticalAlignment="Center" 
            Margin="1,1,1,1"
            Fill="{StaticResource BackgroundBrush}"
                              Stroke="{StaticResource BorderBrush}"
            Data="M 4 0 L 8 4 L 4 8 Z"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked"
               Value="True">
                            <Setter Property="Data"
                TargetName="ExpandPath"
                Value="M 0 4 L 8 4 L 4 8 Z"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style   TargetType="{x:Type TreeViewItem}" >
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeViewItem}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="3" x:Name="TreeViewIndent" />
                            <ColumnDefinition MinWidth="15" Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <ToggleButton 
            x:Name="Expander"
                            Grid.Column="1"
            Style="{StaticResource ExpandCollapseToggleStyle}"
            IsChecked="{Binding Path=IsExpanded,RelativeSource={RelativeSource TemplatedParent}}"
            ClickMode="Press"/>
                        <Border 
            Name="Border" 
            Grid.Column="2" 
            Padding="1">
                            <ContentPresenter 
              x:Name="PART_Header"
              ContentSource="Header"
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                        </Border>
                        <ItemsPresenter 
            x:Name="ItemsHost"
            Grid.Row="1"
            Grid.Column="1"
            Grid.ColumnSpan="3" 
                            
                            />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="false">
                            <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="Expander" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#DDDDDD"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

<Style TargetType="{x:Type c:Views.SelectionPanelItem}" BasedOn="{StaticResource {x:Type TreeViewItem}}"/>

        <!-- Button -->

    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle 
              Margin="2"
              StrokeThickness="1"
              Stroke="#60000000"
              StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Button}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="Foreground" Value="{StaticResource ControlForegroundBrush}"/>
        <Setter Property="MinHeight" Value="15"/>
        <Setter Property="MinWidth" Value="25"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border 
            x:Name="Border"  
            CornerRadius="2" 
            BorderThickness="1"
            Background="{StaticResource ControlBackgroundBrush}"
            BorderBrush="{StaticResource ControlBorderBrush}">
                        <ContentPresenter 
              Margin="2"
              HorizontalAlignment="Center"
              VerticalAlignment="Center" 
              RecognizesAccessKey="True"/>

                       
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource MouseOverBackgroundBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource MouseOverForegroundBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource MouseDownBackgroundBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource BackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource BorderBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- MetaExpander Control Template -->
    <ControlTemplate x:Key="ExpanderToggleButton" TargetType="ToggleButton">
        <Border
    Name="Border" 
    CornerRadius="2,0,0,0"
    Background="Transparent"
    BorderBrush="{StaticResource BorderBrush}"
    BorderThickness="0,0,0,0">
            <Path
            Name="Arrow"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Data="M 0 0 L 4 4 L 8 0 Z"
            Stroke="{StaticResource ForegroundBrush}"
            Fill="{StaticResource BackgroundBrush}">
            </Path>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="False">
                <Setter TargetName="Arrow" Property="RenderTransform">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="1"/>
                            <SkewTransform AngleX="0" AngleY="0"/>
                            <RotateTransform Angle="90"/>
                            <TranslateTransform X="8" Y="0"/>
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter TargetName="Arrow" Property="Fill" Value="{DynamicResource GlyphOverBrush}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="Arrow" Property="Fill" Value="{DynamicResource GlyphPressedBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
        
        <Style x:Key="MetaExpander" TargetType="Expander">

        <Setter Property="FontSize" Value="14px"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Expander">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Name="ContentRow" Height="0"/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="20"/>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter
                           Grid.Column="0"
                           HorizontalAlignment="Right"
                           Margin="4"
                           ContentSource="Header"
                           RecognizesAccessKey="True"/>
                            <ToggleButton
                           Grid.Column="1"
                           Background="{StaticResource BackgroundBrush}"
                           IsChecked="{Binding Path=IsExpanded,Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                           OverridesDefaultStyle="True"
                           Template="{StaticResource ExpanderToggleButton}"/>

                        </Grid>
                        <!--</Border>-->
                        <Border
                     Name="Content"
                     Grid.Row="1" 
                     SnapsToDevicePixels="True"
                     Background="{StaticResource BackgroundBrush}"
                     BorderBrush="{StaticResource BorderBrush}"
                     BorderThickness="1,1,1,1"
                     CornerRadius="1,1,1,1" 
                     Margin="2,2,2,2">
                            <ContentPresenter Margin="4"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="True">
                            <Setter TargetName="ContentRow" Property="Height" Value="{Binding ElementName=Content,Path=DesiredHeight}"/>
                        </Trigger>
                        <!--<Trigger Property="IsEnabled" Value="False">
                     <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                     <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}"/>
                     <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                  </Trigger>-->
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

        
    <!-- ComboBox      -->    
        
    <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Border
      x:Name="Border" 
      Grid.ColumnSpan="2"
      CornerRadius="2"
      Background="#C0C0C0"
      BorderBrush="{StaticResource BorderBrush}"
      BorderThickness="1" />
            <Border 
      Grid.Column="0"
      CornerRadius="2,0,0,2" 
      Margin="1" 
      Background="#FFFFFF" 
      BorderBrush="#404040"
      BorderThickness="0,0,1,0" />
            <Path 
      x:Name="Arrow"
      Grid.Column="1"     
      Fill="#404040"
      HorizontalAlignment="Center"
      VerticalAlignment="Center"
      Data="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                <Setter TargetName="Border" Property="Background" Value="#808080" />
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="true">
                <Setter TargetName="Border" Property="Background" Value="#E0E0E0" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="Border" Property="Background" Value="#EEEEEE" />
                <Setter TargetName="Border" Property="BorderBrush" Value="#AAAAAA" />
                <Setter Property="Foreground" Value="#888888"/>
                <Setter TargetName="Arrow" Property="Fill" Value="#888888" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
        <Border x:Name="PART_ContentHost" Focusable="False" Background="{StaticResource BackgroundBrush}" />
    </ControlTemplate>

    <Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid>
                        <ToggleButton 
            Name="ToggleButton" 
            Template="{StaticResource ComboBoxToggleButton}" 
            Grid.Column="2" 
            Focusable="false"
            IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
            ClickMode="Press">
                        </ToggleButton>
                        <ContentPresenter
            Name="ContentSite"
            IsHitTestVisible="False" 
            Content="{TemplateBinding SelectionBoxItem}"
            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
            Margin="3,3,23,3"
            VerticalAlignment="Center" 
            HorizontalAlignment="Left" />
                        <TextBox x:Name="PART_EditableTextBox"
            Style="{x:Null}" 
            Template="{StaticResource ComboBoxTextBox}" 
            HorizontalAlignment="Left" 
            VerticalAlignment="Center" 
            Margin="3,3,23,3"
            Focusable="True" 
            Background="Transparent"
            Visibility="Hidden"
            IsReadOnly="{TemplateBinding IsReadOnly}"/>
                        <Popup 
            Name="Popup"
            Placement="Bottom"
            IsOpen="{TemplateBinding IsDropDownOpen}"
            AllowsTransparency="True" 
            Focusable="False"
            PopupAnimation="Slide">
                            <Popup.BitmapEffect>
                                    <DropShadowBitmapEffect   ShadowDepth="3" Direction="320" Opacity="0.5" Color="DarkGray" />
                            </Popup.BitmapEffect>
                            <Grid 
              Name="DropDown"
              SnapsToDevicePixels="True"                
              MinWidth="{TemplateBinding ActualWidth}"
              MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                <Border 
                x:Name="DropDownBorder"
                Background="{StaticResource BackgroundBrush}"
                BorderThickness="1"
                BorderBrush="{StaticResource BorderBrush}"/>
                                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                                    <StackPanel x:Name="PART_ItemList" IsItemsHost="True"   KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4"/>
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEditable"
               Value="true">
                            <Setter Property="IsTabStop" Value="false"/>
                            <Setter TargetName="PART_EditableTextBox" Property="Visibility"	Value="Visible"/>
                            <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- SimpleStyles: ComboBoxItem -->

    <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                    <Border 
          Name="Border"
          Padding="2"
          SnapsToDevicePixels="true">
                        <ContentPresenter />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="#DDDDDD"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#888888"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>